package com.bbva.gptf.back.dominio;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.roo.addon.dbre.RooDbManaged;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(identifierType = Tgpt019ColumnaPK.class, versionField = "", table = "TGPT019_COLUMNA", schema = "DBSGPT")
@RooDbManaged(automaticallyDelete = true)
public class Tgpt019Columna {

	public static List<Tgpt019Columna> obtieneColumnas(BigDecimal cdVista) {
		if (cdVista == null) {
			return null;
		}
		return entityManager()
				.createQuery(
						"FROM Tgpt019Columna columna "
								+ "WHERE columna.tgpt018GpoColumna.cdVista.cdVista = :cdVista",
						Tgpt019Columna.class).setParameter("cdVista", cdVista)
				.getResultList();
	}
}
